home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / misc / math / MathFX_src.lha / setphy.c < prev    next >
C/C++ Source or Header  |  1995-12-20  |  574b  |  23 lines

  1. /* Sets up physical limits of plotting device and the mapping between */
  2. /* normalized device coordinates and physical coordinates */
  3.  
  4. #include "mathfx.h"
  5.  
  6. void setphy(xmin,xmax,ymin,ymax)
  7. int xmin,xmax,ymin,ymax;
  8. {
  9.     float xpmm, ypmm, mpxscl, mpyscl;
  10.  
  11.     sphy(xmin,xmax,ymin,ymax);
  12.     sdp((double)(xmax-xmin),(double)(xmin),(double)(ymax-ymin),
  13.          (double)(ymin));
  14.  
  15.     gpixmm(&xpmm,&ypmm);
  16.     mpxscl = xpmm;
  17.     if (xmax <= xmin) mpxscl = -xpmm;
  18.     mpyscl = ypmm;
  19.     if (ymax <= ymin) mpyscl = -ypmm;
  20.     smp(mpxscl,(double)(xmin), mpyscl,(double)(ymin));
  21. }
  22.  
  23.